home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
led
/
ledvb25
/
vcview.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-13
|
2KB
|
108 lines
// vcview.cpp : implementation of the CVcView class
//
#include "stdafx.h"
#include "vc.h"
#include "vcdoc.h"
#include "vcview.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVcView
IMPLEMENT_DYNCREATE(CVcView, CFormView)
BEGIN_MESSAGE_MAP(CVcView, CFormView)
//{{AFX_MSG_MAP(CVcView)
ON_VBXEVENT(VBN_CLICK, IDC_LED3, OnClickLed3)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVcView construction/destruction
CVcView::CVcView()
: CFormView(CVcView::IDD)
{
//{{AFX_DATA_INIT(CVcView)
m_led3 = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CVcView::~CVcView()
{
}
void CVcView::DoDataExchange(CDataExchange* pDX)
{
long value;
char str[15];
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CVcView)
DDX_Control(pDX, IDC_EDIT1, m_edit);
DDX_VBControl(pDX, IDC_LED3, m_led3);
//}}AFX_DATA_MAP
value=m_led3->GetNumProperty("Value");
sprintf(str,"%li",value);
m_edit.SetWindowText(str);
}
/////////////////////////////////////////////////////////////////////////////
// CVcView diagnostics
#ifdef _DEBUG
void CVcView::AssertValid() const
{
CFormView::AssertValid();
}
void CVcView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
CVcDoc* CVcView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVcDoc)));
return (CVcDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CVcView message handlers
void CVcView::OnClickLed3(UINT, int, CWnd*, LPVOID)
{
long value;
char str[15];
value=m_led3->GetNumProperty("Value");
sprintf(str,"%li",value);
m_edit.SetWindowText(str);
}
void CVcView::OnChangeEdit1()
{
long value;
CString cstr;
m_edit.GetWindowText(cstr);
value = atol(cstr);
m_led3->SetNumProperty("Value",value);
}